import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

import login from '../views/login.vue'
import menu from '../views/menu.vue'
import index from '../views/index.vue'
import school from '../views/school.vue'
import clbum from '../views/clbum.vue'
import userinfo from '../views/userinfo.vue'
import classify from '../views/classify.vue'
import contents from '../views/contents.vue'
import record from '../views/record.vue'
import task from '../views/task.vue'
import resource from '../views/resource.vue'
import myresource from '../views/myresource.vue'
import collect from '../views/collect.vue'
import task_info from '../views/task_info.vue'

var routes = [
  {
    path:'/',
    name: 'login',
    component: login,
  },
  {
    path:'/menu',
    name: 'menu',
    component: menu,
    children:[
      {
        path:'index',
        name: 'index',
        component: index,
      },
      {
        path:'school',
        name: 'school',
        component: school,
      },
      {
        path:'clbum',
        name: 'clbum',
        component: clbum,
      },
      {
        path:'userinfo',
        name: 'userinfo',
        component: userinfo,
      },
      {
        path:'classify',
        name: 'classify',
        component: classify,
      },
      {
        path:'contents',
        name: 'contents',
        component: contents,
      },
      {
        path:'record',
        name: 'record',
        component: record,
      },
      {
        path:'task',
        name: 'task',
        component: task,
      },
      {
        path:'resource',
        name: 'resource',
        component: resource,
      },
      {
        path:'myresource',
        name: 'myresource',
        component: myresource,
      },
      {
        path:'collect',
        name: 'collect',
        component: collect,
      },
      {
        path:'task_info',
        name: 'task_info',
        component: task_info,
      },
    ]
  },
  
]


const router = new createRouter({
  history: createWebHistory(), // history为必填项
  //history:createWebHashHistory(),
  routes,
})

export {
  router
}
